package com.bjsxt.common.util;

import java.util.Random;

import org.springframework.stereotype.Component;

@Component("regexUtil")
public class RegexUtil {
	public String Str = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" ;
	//生成随机字符串
	public String randString(int length){
		StringBuffer sb=new StringBuffer();
		Random rand=new Random();
		for(int i=0;i<length;i++){
			int randCh=rand.nextInt(this.Str.length());
			sb.append(this.Str.charAt(randCh));
			
		}
		return sb.toString();
	}
}
	
